<%-- 
	===================================================================================================================
		MUGU Soft
		
		标签: <mg:paging>
	
		说明：分页标签。
	===================================================================================================================
--%>

<%@ tag language="java" pageEncoding="utf-8"%>
<%@ include file="inc/taglibs.jsp" %>

<%@ attribute name="currentPage" type="java.lang.Integer" required="true" description="" %>
<%@ attribute name="pageSize" type="java.lang.Integer" required="false" description="" %>
<%@ attribute name="total" type="java.lang.Integer" required="true" description="" %>
<%@ attribute name="baseUrl" type="java.lang.String" required="true" description="" %>

<%
if(pageSize == null || pageSize <= 0){
	jspContext.setAttribute("pageSize", 15);
}

if(total <= 0){
%>
无数据
<%
}else{
	long pageCount = 1;
	if(total % pageSize == 0){
		pageCount = total / pageSize;
	}else{
		pageCount = (total / pageSize) + 1;
	}
	jspContext.setAttribute("pageCount", pageCount);
%>
<div class="pagingnavi">
<a href="${baseUrl}page=1">首页</a>
<%
// 上一页
if(currentPage > 1){
%>
	<a href="${baseUrl}page=${currentPage-1}">上一页</a>
<%
}else{
%>
	<font color="#000">上一页</font>
<%
}

// 下一页
if(currentPage < pageCount){
%>
	<a href="${baseUrl}page=${currentPage+1}">下一页</a>
<%
}else{
%>
	<font color="#000">下一页	</font>
<%
}

// 尾页
%>
<a href="${baseUrl}page=${pageCount}">尾页</a>
总共${total}条记录   第${currentPage}/${pageCount}页  
</div>
<%
}
%>
